package java_basics;

import java.util.Scanner;

/**
 * @author 孤雪唯方
 * @date 2024/07/16
 * @description 交换值
 */
public class CrossoverValue {

    /**
     * @param a
     * @param b
     * @description 交换两个变量的值
     */
    public static void swap(int a, int b) {
        int temp = a;
        a = b;
        b = temp;
        System.out.println("a = " + a + ", b = " + b);
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter the value of a: ");
        int a = sc.nextInt();
        System.out.print("Enter the value of b: ");
        int b = sc.nextInt();
        swap(a, b);
    }
}
